package ar.com.fiuba.domain.api;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;

import ar.com.fiuba.application.impl.FileDataSource;

public class ErrorGenerator {
	
	int numberOfWords;
	int totalNumberOfCorrectWords;
	FileDataSource correctWordsFile;
	protected ArrayList<String> correctWordsArray;
	
	public ArrayList<String> getCorrectWordsArray() {
		return correctWordsArray;
	}


	public ErrorGenerator(String inputFileName, int numberOfWords)
	{
		this.numberOfWords = numberOfWords;
		correctWordsArray = new ArrayList<String>();
		try {
			correctWordsFile = new FileDataSource(inputFileName);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		//generate arrayWithCorrectWords
		int i = 0;
		while(correctWordsFile.getNextWord() != null && i < numberOfWords){
			  String aux=correctWordsFile.getNextWord();
			  if(aux.length() > 2)
			  {	  correctWordsArray.add(aux);
			  		i++;
			  }		
		  }
	}
	
	public ArrayList<String> generateErrorAtTheBeginning()
	{
		return null;
	}
	
	public ArrayList<String> generateErrorAtTheEnd()
	{
		return null;
	}
	
	public ArrayList<String> generateErrorInTheMiddle()
	{
		return null;
	}
	
}
